package com.epsilon.pos.proveedores.view;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;

import com.epsilon.commons.util.SWTResourceManager;

public class ProveedorComposite extends Composite {
	private Text	txtNombre;
	private Text	txtContacto;
	private Text	txtObservaciones;
	private Button	btnCancelar;
	private Button	btnAgregar;

	/**
	 * Create the composite.
	 * 
	 * @param parent
	 * @param style
	 */
	public ProveedorComposite( Composite parent, int style ) {
		super( parent, style );

		Label lblNewLabel = new Label( this, SWT.NONE );
		lblNewLabel.setBounds( 10, 10, 111, 13 );
		lblNewLabel.setText( "Nombre del proveedor:" );

		txtNombre = new Text( this, SWT.BORDER );
		txtNombre.setBounds( 10, 29, 460, 19 );

		Label lblNewLabel_1 = new Label( this, SWT.NONE );
		lblNewLabel_1.setBounds( 10, 54, 92, 13 );
		lblNewLabel_1.setText( "Datos de contacto:" );

		txtContacto = new Text( this, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL );
		txtContacto.addFocusListener( new FocusAdapter() {
			@Override
			public void focusGained( FocusEvent arg0 ) {
			}
		} );
		txtContacto.setBounds( 10, 73, 460, 38 );

		Label lblNewLabel_2 = new Label( this, SWT.NONE );
		lblNewLabel_2.setBounds( 10, 117, 460, 13 );
		lblNewLabel_2.setText( "Observaciones:" );

		txtObservaciones = new Text( this, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL );
		txtObservaciones.setBounds( 10, 136, 460, 38 );

		btnAgregar = new Button( this, SWT.NONE );
		btnAgregar.setImage( SWTResourceManager.getImage( ProveedorComposite.class,
				"/com/epsilon/commons/util/images/ok.png" ) );
		btnAgregar.setBounds( 337, 180, 133, 23 );
		btnAgregar.setText( "Agregar" );

		btnCancelar = new Button( this, SWT.NONE );
		btnCancelar.setImage( SWTResourceManager.getImage( ProveedorComposite.class,
				"/com/epsilon/commons/util/images/cancel.png" ) );
		btnCancelar.setBounds( 198, 180, 133, 23 );
		btnCancelar.setText( "Cancelar" );

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}

	public Text getTxtNombre() {
		return txtNombre;
	}

	public Text getTxtContacto() {
		return txtContacto;
	}

	public Text getTxtObservaciones() {
		return txtObservaciones;
	}

	public Button getBtnCancelar() {
		return btnCancelar;
	}

	public Button getBtnAgregar() {
		return btnAgregar;
	}
}
